package com.janko.springbootbase.juc.cas;

/**
 * @Author janko
 * @Version 1.0
 * @date 2021/4/11 21:54
 * @Description 类文件说明
 */
public class CASTest {
    static  Integer num=0;
    public static void main(String[] args) {

        for (int i = 0; i < 3; i++) {
            Thread thread=new Thread(new Runnable() {
                @Override
                public void run() {
                    while(num<1000){
                        System.out.println("Thread Name:" + Thread.currentThread().getName() + ": " + num++);
                    }
                }
            });
            thread.start();
        }
    }
}
